<template>
  <div class="flex" >
    <criteria-paged :model="model" v-ref:paged>
      <criteria partial='criteria' @condition-changed='$parent.search' v-ref:cri>
       <div novalidate class="form-inline" partial>
         <div class="form-group">
           <input  type="number" class="form-control" v-model="model.f_userinfo_id" placeholder='用户编号'
           condition="f_userinfo_id = '{}'" v-next-el='yhxm'
           :size="model.f_userinfo_id ? model.f_userinfo_id.length  : 2">
         </div>
         <div class="form-group">
           <input  type="text" class="form-control" v-model="model.f_userinfo_id" placeholder='用户姓名'
           condition="f_user_name like '%{}%'" v-next-el='resentialarea' v-el:yhxm
           :size="model.f_user_name ? model.f_user_name.length  : 4">
         </div>
         <div class="form-group">
           <input type="text" class="form-control" v-model="model.f_area" placeholder='区域'
           condition="f_area like '%{}%'" v-el:xq v-next-el='cx' v-el:resentialarea
           :size="model.f_area ? model.f_area.length : 2">
         </div>
         <div class="form-group">
           <input  type="text" class="form-control" v-model="model.f_address" placeholder='用户地址'
           condition="f_address like '%{}%'" v-next-el='cx' v-el:resentialarea
           :size="model.f_address ? model.f_address.length * 2 : 4">
         </div>
         <div class="form-group">
           <button class="btn btn-success" @click="search()" v-el:cx>查询</button>
           <export-excel :data="{orderitem: 'f_userinfo_id', condition: '1=1'}" bean="欠费用户信息导出" sqlurl="rs/logic/exportfile"></export-excel>
         </div>
       </div>
      </criteria>
      <data-grid  :model="model" partial='list' v-ref:grid>
        <template partial='head'>
          <tr>
             <th>序号</th>
             <th>用户编号</th>
             <th>用户姓名</th>
             <th>用户类型</th>
             <th>用户电话</th>
             <th>地址</th>
             <th>证件类型</th>
             <th>证件号码</th>
             <th>用气性质</th>
             <th>建档日期</th>
          </tr>
        </template>
        <template partial='body'>
          <td>{{$index+1}}</td>
          <td style="text-align:center">{{row.f_userinfo_id}}</td>
          <td style="text-align:center">{{row.f_user_name}}</td>
          <td style="text-align:center">{{row.f_user_type}}</td>
          <td style="text-align:center">{{row.f_user_phone}}</td>
          <td style="text-align:center">{{row.f_address}}</td>
          <td style="text-align:center">{{row.f_credentials}}</td>
          <td style="text-align:center">{{row.f_idnumber}}</td>
          <td style="text-align:center">{{row.f_gasproperties}}</td>
          <td style="text-align:center">{{row.f_createfile_date}}</td>
        </template>
      </data-grid>
    </criteria-paged>
  </div>
</template>

<script>
/**
*阶梯水价查询列表
*/
import { PagedList } from 'vue-client'
import * as Util from '../../../Util'
export default {
  title: '用户信息查询',
  data () {
    return {
      model: new PagedList('rs/sql/singleTable_OrderBy', 50, {orderitem: '"' + this.orderitem + '"', items: '"' + this.items + '"',
      tablename: '"' + this.tablename + '"'}),
      definedShow: false,
      userdefinedMessage: '',
      ids: [],
      pages: []
    }
  },
  props: {
    orderitem: {
      type: String,
      default: 'f_userinfo_id'
    },
    tablename: {
      type: String,
      default: 't_userinfo'
    },
    items: {
      type: String,
      default: '*'
    }
  },
  ready () {
    this.search({condition: '1=1', model: this.model})
  },
  watch: {
  },
  methods: {
    search (args) {
      if (!Util.f.parent.parent.name.includes('统一资源管理')) {
        args.condition = `${args.condition} and f_filiale = '${Util.f.f_fengongsi}'`
      }
      this.model.search(args.condition, args.model)
    }
  }
}
</script>
